package cz.none.bezbarier.web.webmodel;

import java.util.ArrayList;
import java.util.List;

import cz.none.bezbarier.web.model.Type;

public class Place {
	private String name;
	private String url;
	private String description;
	private String axisx;
	private String axisy;
	private String author;
	private Type type;

	public static List<Place> createPlaces(List<cz.none.bezbarier.web.model.Place> places) {
		List<Place> result = new ArrayList<Place>();
		Place p;

		if (null != places) {
			for (cz.none.bezbarier.web.model.Place place : places) {
				p = new Place();
				p.author = place.getAuthor() != null ? place.getAuthor().getEmail() : "";
				p.axisx = place.getAxisx();
				p.axisy = place.getAxisy();
				p.description = place.getDescription();
				p.name = place.getName();
				p.type = place.getType();
				p.url = place.getUrl();

				result.add(p);
			}
		}

		return result;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public String getAxisx() {
		return axisx;
	}

	public void setAxisx(String axisx) {
		this.axisx = axisx;
	}

	public String getAxisy() {
		return axisy;
	}

	public void setAxisy(String axisy) {
		this.axisy = axisy;
	}

	public String getAuthor() {
		return author;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

}
